package cn.qzzg.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


@Data
@Component
public class WxConfig {
    @Value("${wx-chat.token}")
    private String token;
    @Value("${wx-chat.app-id}")
    private String appId;
    @Value("${wx-chat.app-secret}")
    private String appSecret;
    @Value("${wx-chat.access-token}")
    private String accessToken;
    @Value("${wx-chat.ticket}")
    private String ticket;

    /**
     * 获取授权地址
     */
    private final String authorizeInterface = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECTURI?frontendAddress=FRONTENDADDRESSPARAMTYPE&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
    /**
     * 获取openId地址
     */
    private final String openIdInterface = "https://api.weixin.qq.com/sns/oauth2/access_token";
    /**
     * 获取公众号二维码
     */
    private final String qrCodeInterface = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=ACCESSTOKEN";
    /**
     * 读取公众号二维码
     */
    private final String showQrCodeInterface = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET";
    /**
     * 获取accessToken
     */
    private final String accessTokenInterface = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
    /**
     * 获取ticket
     */
    private final String ticketInterface = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESSTOKEN&type=jsapi";
    /**
     * 删除公众号菜单
     */
    private final String deleteMenuInterface = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESSTOKEN";
    /**
     * 新增公众号菜单
     */
    private final String createMenuInterface = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESSTOKEN";
    /**
     * 菜单URL
     */
    private final String menuUrlInterface = "BACKENDADDRESS/wx/authorize?frontendAddress=FRONTENDADDRESS&backendAddress=BACKENDADDRESS";
}
